<template>
  <span>
    <template v-if="readonly">
      {{ value_display }}
    </template>

    <template v-else>
      <OInputNumber
        v-model="value2"
        :placeholder="node.placeholder || node.string"
        @change="onChange"
      />
    </template>
  </span>
</template>

<script setup>
import OInputNumber from '@/odoojs-antdv/OInput/OInputNumber.vue'

import { useWidget } from './userWidget'

const props = defineProps(['modelValue', 'node', 'formInfo'])
const emit = defineEmits(['update:modelValue', 'change'])

const useData = useWidget(props, { emit })

const { readonly, value_display } = useData
const { value2, onChange } = useData
</script>

<style type="text/css"></style>
